package bd.com.escenic.flexilunch.model;

/**
 * $URL: http://flexilunch.googlecode.com/svn/trunk/common/src/main/java/bd/com/escenic/flexilunch/model/ItemImpl.java $
 * $Id: ItemImpl.java 14 2009-06-03 09:39:19Z shihab.uddin@gmail.com $
 * $Date: 2009-06-03 09:39:19 +0000 (Wed, 03 Jun 2009) $
 * $Author: shihab.uddin@gmail.com $
 * $Revision: 14 $
 */

import java.util.Set;

/**
 * $Id: ItemImpl.java 14 2009-06-03 09:39:19Z shihab.uddin@gmail.com $.
 *
 * @author <a href="mailto:shihab.uddin@gmail.com">Shihab Uddin</a>
 * @version $Revision: 14 $
 */
public class ItemImpl extends AbstractEntity implements Item {

  private Restaurant mRestaurant;
  private boolean mAvailable;
  private Set<Price> mPrices;
  private Set<Order> mOrders;
  private Price mPrice;

  /**
   * {@inheritDoc}
   */
  @Override
  public final Type getType() {
    return Type.ITEM;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public Restaurant getRestaurant() {
    return mRestaurant;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void setRestaurant(final Restaurant pRestaurant) {
    mRestaurant = pRestaurant;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public boolean isAvailable() {
    return mAvailable;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void setAvailable(final boolean pAvailable) {
    mAvailable = pAvailable;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public Set<Price> getPrices() {
    return mPrices;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void setPrices(final Set<Price> pPrices) {
    mPrices = pPrices;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public Set<Order> getOrders() {
    return mOrders;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void setOrders(final Set<Order> pOrders) {
    mOrders = pOrders;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public Price getPrice() {
    return mPrice;
  }

  public void setPrice(final Price pPrice) {
    mPrice = pPrice;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String getDisplayString() {
    return getName() + "-" + getRestaurant().getName() + "-" + getPrice().getAmount();
  }
}
